package replica;

import util.ConfigurationHelper;

public class ReplicaInformation {
	
	public ReplicaInformation(String replicaID,
			int port, int errorCount) {
		super();
		this.id = replicaID;
		this.port = port;
		this.errorCount = errorCount;
	}
	
	public ReplicaInformation(String replicaID) {
		this.port = ConfigurationHelper.getIntProperty(replicaID + ".replica.port");
		this.id = replicaID;
		this.errorCount = 0;
	}
	
	private String id;
	private int port;
	private int errorCount;
	
	public int increaseErrorCount(){
		return ++(this.errorCount);
	}
	
	public void resetErrorCount() {
		this.errorCount = 0;
	}
	
}
